home *** CD-ROM | disk | FTP | other *** search
/ Game Cracker (Expanded Edition) / Game Cracker (Expanded Edition).iso / cracks / SV_ADPIN.ZIP / Addiction Pinball.txt next >
Encoding:
Text File  |  1998-11-15  |  14.5 KB  |  278 lines

  1.  
  2. Free Information Xchange '98 presents:
  3.  
  4. Addiction Pinball - CD crack by Static Vengeance
  5.  
  6. Requirements:
  7. Hex editor and full game install
  8. W32Dasm if you wish to follow along
  9.  
  10.     I have another tutorial to pass along to you.  Like all my past tutorials I will be showing
  11. you how to hunt down and defeat a CD check.  Also I'll be using my favorite programs for cracking,
  12. those being W32Dasm from URSoft and HEdit from Yuri Software.  With that said, let's get to FiX'ing
  13. what needs to be FiX'ed:
  14.     This time the game I'll be working with is Addiction Pinball (AP) from MicroProse (Team17).
  15. This is a Win95 based game so it should be somewhat easy to crack.  First thing to do, is to install
  16. the game and run it without the CD to see how it asks for it.  AP comes up with a simple pop-up dialog
  17. box asking for the original CD.  No problem, we'll start up W32Dasm and look for that data reference.
  18. Once you have disassembled pinball.exe you'll see there is no direct reference to the "Insert CD..."
  19. string.  Well, next in line for things to try is to look for the KERNEL32 call "GetDriveTypeA"  Using
  20. the text string search function of W32Dasm I came across this little bit of code:
  21.  
  22. * Referenced by a CALL at Addresses:
  23. |:00401A8E   , :004033BC   , :00403BD5                        ; Called from three different locations
  24. |
  25. :0043E8F0 83EC44                  sub esp, 00000044
  26. :0043E8F3 53                      push ebx
  27. :0043E8F4 56                      push esi
  28. :0043E8F5 57                      push edi
  29. :0043E8F6 55                      push ebp
  30. :0043E8F7 BB02000000              mov ebx, 00000002           ; We'll use this instruction later
  31.  
  32. * Reference To: KERNEL32.GetLogicalDrives, Ord:00F9h          ; Commonly used in CD check routines
  33.                                   |
  34. :0043E8FC FF156C934700            Call dword ptr [0047936C]
  35. :0043E902 8BF8                    mov edi, eax
  36. :0043E904 8B74245C                mov esi, dword ptr [esp+5C]
  37. :0043E908 C64424113A              mov [esp+11], 3A
  38. :0043E90D C64424125C              mov [esp+12], 5C
  39. :0043E912 C644241300              mov [esp+13], 00
  40.  
  41. * Reference To: KERNEL32.GetVolumeInformationA, Ord:014Eh     ; Check for the volume name of the CD
  42.                                   |
  43. :0043E917 8B2D64934700            mov ebp, dword ptr [00479364]
  44.  
  45. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  46. |:0043E96F(C)
  47. |
  48. :0043E91D B801000000              mov eax, 00000001
  49. :0043E922 8ACB                    mov cl, bl
  50. :0043E924 D3E0                    shl eax, cl
  51. :0043E926 85C7                    test edi, eax
  52. :0043E928 7441                    je 0043E96B
  53. :0043E92A 8D4361                  lea eax, dword ptr [ebx+61]
  54. :0043E92D 88442410                mov byte ptr [esp+10], al
  55. :0043E931 8D442410                lea eax, dword ptr [esp+10]
  56. :0043E935 50                      push eax
  57.  
  58. * Reference To: KERNEL32.GetDriveTypeA, Ord:00DEh               ; What lead us here
  59.                                   |
  60. :0043E936 FF1568934700            Call dword ptr [00479368]
  61. :0043E93C 83F805                  cmp eax, 00000005             ; 05 is the code value for a CD ROM drive
  62. :0043E93F 752A                    jne 0043E96B                  ; If NOT a CD the exit to the fail code
  63. :0043E941 8D442414                lea eax, dword ptr [esp+14]
  64. :0043E945 6A00                    push 00000000
  65. :0043E947 8D4C2414                lea ecx, dword ptr [esp+14]
  66. :0043E94B 6A00                    push 00000000
  67. :0043E94D 6A00                    push 00000000
  68. :0043E94F 6A00                    push 00000000
  69. :0043E951 6A00                    push 00000000
  70. :0043E953 6A40                    push 00000040
  71. :0043E955 50                      push eax
  72. :0043E956 51                      push ecx
  73. :0043E957 FFD5                    call ebp
  74. :0043E959 8D4C2414                lea ecx, dword ptr [esp+14]
  75. :0043E95D 56                      push esi
  76. :0043E95E 51                      push ecx
  77. :0043E95F E8FCDD0100              call 0045C760
  78. :0043E964 83C408                  add esp, 00000008
  79. :0043E967 85C0                    test eax, eax
  80. :0043E969 7412                    je 0043E97D             ; Take this jump to contiune with the CD check
  81.  
  82. * Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
  83. |:0043E928(C), :0043E93F(C)
  84. |
  85. :0043E96B 43                      inc ebx                 ; Counter for the CD check loop
  86. :0043E96C 83FB20                  cmp ebx, 00000020       ; Try upto 32 times
  87. :0043E96F 7CAC                    jl 0043E91D
  88. :0043E971 33C0                    xor eax, eax            ; A zero in EAX means the CD check failed
  89. :0043E973 5D                      pop ebp
  90. :0043E974 5F                      pop edi
  91. :0043E975 5E                      pop esi
  92. :0043E976 5B                      pop ebx
  93. :0043E977 83C444                  add esp, 00000044
  94. :0043E97A C20800                  ret 0008                ; Return to the caller
  95.  
  96. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  97. |:0043E969(C)
  98. |
  99. :0043E97D 8B542458                mov edx, dword ptr [esp+58]
  100. :0043E981 85D2                    test edx, edx
  101. :0043E983 7423                    je 0043E9A8
  102. :0043E985 8D7C2410                lea edi, dword ptr [esp+10]
  103. :0043E989 B9FFFFFFFF              mov ecx, FFFFFFFF
  104. :0043E98E 2BC0                    sub eax, eax
  105. :0043E990 F2                      repnz
  106. :0043E991 AE                      scasb
  107. :0043E992 F7D1                    not ecx
  108. :0043E994 2BF9                    sub edi, ecx
  109. :0043E996 8BC1                    mov eax, ecx
  110. :0043E998 C1E902                  shr ecx, 02
  111. :0043E99B 8BF7                    mov esi, edi
  112. :0043E99D 8BFA                    mov edi, edx
  113. :0043E99F F3                      repz
  114. :0043E9A0 A5                      movsd
  115. :0043E9A1 8BC8                    mov ecx, eax
  116. :0043E9A3 83E103                  and ecx, 00000003
  117. :0043E9A6 F3                      repz
  118. :0043E9A7 A4                      movsb
  119.  
  120. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  121. |:0043E983(C)
  122. |                                                          ; Ultimately where we want to get!
  123. :0043E9A8 B801000000              mov eax, 00000001        ; Set up for passed CD check
  124. :0043E9AD 5D                      pop ebp
  125. :0043E9AE 5F                      pop edi
  126. :0043E9AF 5E                      pop esi
  127. :0043E9B0 5B                      pop ebx
  128. :0043E9B1 83C444                  add esp, 00000044
  129. :0043E9B4 C20800                  ret 0008                 ; Return to the caller
  130.  
  131.     Alright, with that section of the CD check code explained you can see we need to get down to
  132. 43E9A8 for the code to return the right value in EAX for a passed CD check.  The other option would
  133. be to back trace the calling function and eliminate the calls to the CD check routine and force the
  134. code that checks for 01 to be in EAX to pass.  To me, this is the perferred method of cracking, why
  135. run the CD check if it'll fail anyways.  Well I went back and found all three calls and tried to
  136. overwrite them with mov eax, 00000001 (EI: make sure EAX is loaded with 01 like a good CD check).
  137. However this would only work with the first check and failed with the other two because the program
  138. pushes a 00000000 on the stack before the last two calls.  I couldn't seem to get around that so I
  139. decided to look at the above code one more time to find a good place to put (or force) a jump down to
  140. 43E9A8.  This way the routine jumps right to the "found the CD" portion of code and doesn't actually
  141. check for the CD.  Looking back you'll see at 43E8F7 the instruction "mov ebx, 00000002."  This is
  142. the perfect spot for our little redirection of the CD checking code.  Not only that but the instruction
  143. is also the same length as a jmp long (IE jmp with 32 bit displacement) instruction.  So calculating the
  144. right displacement is all that's needed to FiX this code.  Replacing the mov ebx, 00000002 with a jmp
  145. 43E9A8 will solve all our problems.
  146.     There is however and secondary type of check that goes through the WINMM (Windows Mulit-media)
  147. system calls.  I was able to track this down after some thought.  First I checked to see how the calls
  148. to the first CD checks where made and I found this:
  149.  
  150. * Possible StringData Ref from Data Obj ->"ADDICTION"            ; Volume of the CD
  151.                                   |
  152. :004033AF 68BCEE4600              push 0046EEBC
  153. :004033B4 8B0D20504700            mov ecx, dword ptr [00475020]
  154. :004033BA 6A00                    push 00000000
  155. :004033BC E82FB50300              call 0043E8F0                  ; The above CD check
  156. :004033C1 85C0                    test eax, eax                  ; Check eax  00=fail, 01=pass
  157. :004033C3 750A                    jne 004033CF                   ; "Jump Not Equal" means we must take this jump
  158. :004033C5 B90B000000              mov ecx, 0000000B
  159. :004033CA E8E1FA0200              call 00432EB0                  ; Set up to quit to Win95
  160.  
  161.     With that in mind and looking for MCISendCommandA calls I searched for the string "mcisendcommanda"
  162. and found a few hits.  However this one seemed more interesting then the others:
  163.  
  164. * Referenced by a CALL at Addresses:
  165. |:00401EED   , :0043FE05                                         ; Called twice
  166. |
  167. :00442360 83EC30                  sub esp, 00000030
  168. :00442363 53                      push ebx
  169. :00442364 56                      push esi
  170. :00442365 57                      push edi
  171. :00442366 8BF1                    mov esi, ecx
  172. :00442368 55                      push ebp
  173. :00442369 E8A24F0100              call 00457310
  174. :0044236E 8D462C                  lea eax, dword ptr [esi+2C]
  175. :00442371 33C9                    xor ecx, ecx
  176. :00442373 89460C                  mov dword ptr [esi+0C], eax
  177. :00442376 894E30                  mov dword ptr [esi+30], ecx
  178. :00442379 894E34                  mov dword ptr [esi+34], ecx
  179. :0044237C 89763C                  mov dword ptr [esi+3C], esi
  180. :0044237F BB00200000              mov ebx, 00002000
  181. :00442384 8D4628                  lea eax, dword ptr [esi+28]
  182. :00442387 C7463800FF0000          mov [esi+38], 0000FF00
  183. :0044238E C6463B01                mov [esi+3B], 01
  184. :00442392 C74624FFFFFFFF          mov [esi+24], FFFFFFFF
  185.  
  186. * Possible StringData Ref from Data Obj ->"cdaudio"               ; Checking for an audio CD
  187.                                   |
  188. :00442399 C7442428DC534700        mov [esp+28], 004753DC
  189. :004423A1 3808                    cmp byte ptr [eax], cl
  190. :004423A3 7409                    je 004423AE
  191. :004423A5 BB00220000              mov ebx, 00002200
  192. :004423AA 8944242C                mov dword ptr [esp+2C], eax
  193.  
  194. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  195. |:004423A3(C)
  196. |
  197. :004423AE 8D6C2420                lea ebp, dword ptr [esp+20]
  198.  
  199. * Reference To: WINMM.mciSendCommandA, Ord:0032h                   ; The string we were looking for
  200.                                   |
  201. :004423B2 8B3DE0944700            mov edi, dword ptr [004794E0]
  202. :004423B8 55                      push ebp
  203. :004423B9 53                      push ebx
  204. :004423BA 6803080000              push 00000803
  205. :004423BF 6A00                    push 00000000
  206. :004423C1 FFD7                    call edi
  207. :004423C3 85C0                    test eax, eax
  208. :004423C5 7415                    je 004423DC
  209. :004423C7 81E3FFFDFFFF            and ebx, FFFFFDFF
  210. :004423CD 55                      push ebp
  211. :004423CE 53                      push ebx
  212. :004423CF 6803080000              push 00000803
  213. :004423D4 6A00                    push 00000000
  214. :004423D6 FFD7                    call edi
  215. :004423D8 85C0                    test eax, eax
  216. :004423DA 7564                    jne 00442440
  217.  
  218. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  219. |:004423C5(C)
  220. |
  221. :004423DC 8B442424                mov eax, dword ptr [esp+24]
  222. :004423E0 8D4C2434                lea ecx, dword ptr [esp+34]
  223. :004423E4 51                      push ecx
  224. :004423E5 894624                  mov dword ptr [esi+24], eax
  225. :004423E8 6800040000              push 00000400
  226. :004423ED 8BCE                    mov ecx, esi
  227. :004423EF C74424400A000000        mov [esp+40], 0000000A
  228. :004423F7 680D080000              push 0000080D
  229. :004423FC E85F010000              call 00442560
  230. :00442401 33C0                    xor eax, eax
  231. :00442403 8D4C2410                lea ecx, dword ptr [esp+10]
  232. :00442407 89442410                mov dword ptr [esp+10], eax
  233. :0044240B 51                      push ecx
  234. :0044240C 6802010000              push 00000102
  235. :00442411 8BCE                    mov ecx, esi
  236. :00442413 8944241C                mov dword ptr [esp+1C], eax
  237. :00442417 6814080000              push 00000814
  238. :0044241C C744242403000000        mov [esp+24], 00000003
  239. :00442424 89442428                mov dword ptr [esp+28], eax
  240. :00442428 E833010000              call 00442560
  241. :0044242D 8B4C2414                mov ecx, dword ptr [esp+14]
  242. :00442431 83F91E                  cmp ecx, 0000001E                 ; Compare for ???
  243. :00442434 730A                    jnb 00442440                      ; Conditional jump
  244. :00442436 B9B8090000              mov ecx, 000009B8
  245. :0044243B E8700AFFFF              call 00432EB0                     ; The "exit to windows" jump
  246.  
  247. * Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
  248. |:004423DA(C), :00442434(C)
  249. |
  250. :00442440 5D                      pop ebp
  251. :00442441 5F                      pop edi
  252. :00442442 5E                      pop esi
  253. :00442443 5B                      pop ebx
  254. :00442444 83C430                  add esp, 00000030
  255. :00442447 C3                      ret
  256.  
  257.     Well that seems odd, to have a jump to the exit code within this routine.  So I changed the jnb
  258. to jmp at 442434 and ran the game.  Everything worked and I could play the game without the CD online.
  259. I missed this the first time due to having a program called FlexiCD (from MS Powertoys) being active.
  260. Once I exitted FlexiCD, Addiction Pinball would quick back to Win95 all the time.  So I went back into
  261. the code and looked for a secondary CD check (like the above code).  Once I forced the conditional jump
  262. at 442434 to always jump over the exit call Addiction Pinball was running just fine without the CD even
  263. if FlexiCD wasn't running.  So now I know I have a complete 100% working crack... this time!
  264.  
  265.   To crack this game make the following edit:
  266.  
  267. Edit pinball.exe
  268. ============================================
  269. Search for: BB 02 00 00 00 at offset 253,175
  270. Change to : E9 AC 00 00 00
  271.  
  272. Search for: 83 F9 1E 73 0A at offset 268,337
  273. Change to : -- -- -- EB --
  274.  
  275.     Two simple edits is "all" it takes to FiX Addiction Pinball and get rid of the CD check.
  276.  
  277. Static Vengeance
  278.